package service

import (
	"context"
	"home-butler/internal/model"
)

type (
	IDevice interface {
		FindDevice(ctx context.Context, key string) (res *model.Device, err error)
	}
)

var (
	localDevice IDevice
)

func Device() IDevice {
	if localDevice == nil {
		panic("implement not found for interface IDevice, forgot register?")
	}
	return localDevice
}

func RegisterDevice(i IDevice) {
	localDevice = i
}
